<{extend name="index/header" /}>
<{block name="body"}>
    
    <!--[if lt IE 9]>
        <script src="__INDEX__/js/html5shiv.js"></script>
        <script src="__INDEX__/js/respond.min.js"></script>
    <![endif]-->

    <link rel="stylesheet" href="__INDEX__/css/bdstyle.css">
    <style type="text/css">
        .cd-form .icon input[type="file"]{
            padding-left: 0 !important;
        }
        .cd-form .icon input[type="submit"]{
            padding:16px 20px !important;
        }
    </style>

    <section style="width:100%;display:table">
        <div class="error-page-inner">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <form class="cd-form floating-labels" method="post" action="<{:url('zhuanji/photosUpdate')}>" enctype="multipart/form-data">
                            <fieldset>
                                <legend>创建相册</legend>
                                <div class="icon">
                                    <label class="cd-label" for="cd-name">相册名称</label>
                                    <input class="user" type="text" name="photostitle" id="cd-name" required value="<{$photos.photostitle}>">
                                </div>
                                <div class="icon">
                                    <h3>选择封面</h3>
                                    <input type="file" name="file" id="cd-file">
                                </div>
                                <div class="icon">
                                    <h3>选择图片</h3>
                                    <input type="file" name="files[]" id="cd-file2" multiple>
                                </div>
                                <div class="icon">
                                    <label class="cd-label" for="cd-textarea">相册描述</label>
                                    <div class="baidu">
                                        <label class="cd-label" for="cd-textarea">传记详情</label>
                                        <!-- <textarea class="message" name="cd-textarea" id="cd-textarea" required></textarea> -->
                                        <textarea id="cd-textarea" name="photocontent" type="text/plain" style="width:100%;margin:0 auto;resize:none;"><{$photos.photocontent}></textarea>
                                    </div>
                                </div>
                                <div>
                                    <input type="hidden" name="photosid" value="<{$photos.photosid}>">
                                    <input type="submit" value="提交">
                                </div>
                            </fieldset>
                        </form>
                    </div>
                    <div style="width: 90%; max-width: 600px;margin: 4em auto;">
                        <legend>所有相片</legend>
                        <{volist name="photos.photode" id="vo"}>
                        <div class="col-xs-12 col-sm-6 col-md-4">
                            <div class="portfolio-wrapper">
                                <div class="portfolio-single">
                                    <div class="portfolio-thumb" style="height:200px;margin-bottom:20px;">
                                        <img src="<{$vo.photodedir}>" style="width: 100%;height:100%;" class="img-responsive" alt="">
                                    </div>
                                    <div class="portfolio-view">
                                        <ul class="nav nav-pills">
                                            <li>
                                                <a href="javascript:value(0);" onclick="del(this)" photodeid="<{$vo.photodeid}>" data-lightbox="example-set">
                                                    <i class="fa fa-eye"></i>
                                                </a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <{/volist}>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- 编辑页新加1 -->
    <script type="text/javascript" src="__INDEX__/js/modernizr.js"></script>
    <script type="text/javascript" src="__INDEX__/js/bdmain.js"></script>
    <script type="text/javascript">
        //删除
        function del(e){
            var photodeid = $(e).attr('photodeid');
            if(confirm('你确定删除此图片?')){
                $.post("<{:url('zhuanji/photosdelete')}>",{'photodeid':photodeid},function(data){
                    alert(data.flag);
                    window.location.href="";
                },'json');
            }
        }
    </script> 
<{/block}>